package com.java.jiuyang.commons.utils;

/**
 * @ClassName: GaodeUtil
 * @Description:
 * @Version: v1.0.0
 * @Author: Fu Hao
 * @Date: 2019/10/26 0026 上午 11:27
 * Modification History:
 * Date           Author      Version     Description
 * -------------------------------------------------------------
 * 2019/10/26 0026        Fu Hao      v1.0.0         创建
 */
public class GaodeUtil {

    /**
     * 根据地址返回下级区域  高德map数据录入数据库时用到 (每日有访问次数限制)
     * @param address
     * @param subdistrict   规则：设置显示下级行政区级数（行政区级别包括：国家、省/直辖市、市、区/县4个级别）可选值：0、1、2、3
     * @return
     */
    private static final String key ="87d056f6e8cde7af1fac90480914bafc";


    public static String getProvinceInfo(String address,String subdistrict) {
        // URL拼装
        String url ="https://restapi.amap.com/v3/config/district?keywords="+address+"&subdistrict="+subdistrict+"&key="+key;
        // 发送请求
        String resultString = HttpUtil.sendGet(url);
        return resultString;
    }
}
